<html>
<head><meta charset="utf-8"><title>lexing floats · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/lexing.20floats.html">lexing floats</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="171900635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/lexing%20floats/near/171900635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Phil Ellison <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/lexing.20floats.html#171900635">(Jul 28 2019 at 19:17)</a>:</h4>
<p>I'm looking at an issue with rust-analyser: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/1592" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/1592">https://github.com/rust-analyzer/rust-analyzer/issues/1592</a></p>
<p>This appears to come from the rustc lexer deciding that 42f64 is an integer literal: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_lexer/src/lib.rs#L419" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_lexer/src/lib.rs#L419">https://github.com/rust-lang/rust/blob/master/src/librustc_lexer/src/lib.rs#L419</a></p>
<p>Is this a bug in the lexer, or does rustc have special handling for this somewhere higher up?</p>
<p>Edit: it looks like this may be handled here in <a href="https://github.com/rust-lang/rust/blob/a7f28678bbf4e16893bb6a718e427504167a9494/src/libsyntax/parse/literal.rs#L424" target="_blank" title="https://github.com/rust-lang/rust/blob/a7f28678bbf4e16893bb6a718e427504167a9494/src/libsyntax/parse/literal.rs#L424">https://github.com/rust-lang/rust/blob/a7f28678bbf4e16893bb6a718e427504167a9494/src/libsyntax/parse/literal.rs#L424</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>